Cleaning up, fix some issues with the error messages