Error code improvements