Better error messages and handling