Fixed bug and added tests
Uglify