Fixed errors detected by jslint