Fixed JavaScript Errors