Revise error reporting to throw exceptions
Update build