Corrected errors based on JsHint.