Fixed some warnings according to JSHInt suggestions