Merge "Improved error handling." into nyc-dev