code fixes from jslint