Small css and minor checks in javascript