Fixed JSHint and unit test issues