Minor tweak to build files
better exception handling