Fixed error messages on patch errors

Closes #987, #988