Fixed remaining JSHint warnings and errors

@fogus Let me know if you think that any of these warnings should be handled differently. I was trying to keep to the existing project style, but may have missed something.