Fixing JavaScript Errors