Hacked in some more flexible error handling before build