Figured out the second problem on my own. There was some syntax that was incorrect. I'm not sure if it was a problem in the original code itself, or in how I entered it, but it's solved either way.
As for the first problem though, I'm still unable to figure out why I'm getting those error messages.