Some fixes(not all) using jslint