Added more Jasmine unit test coverage and also did some code beautification in another Jasmine unit test.