Improvements to error messages to give more context