Added error handling for uglify errors. Cleaned up some logging code.