Added more error checking. Fixes #16
Grunt build process