Added NO_ERROR and default cases. Merged some vars.