Replaced hardcoded error constants with appropriate macros.