More code cleanup, fix remaining jslint issues