Updated tests and fixed JSHint errors