Improved error handling

Also removed some unnecessary logging and added logging of completion
with total compile time.