Added test
Fixed errors from JSHint