Fixed enforced application error codes (BC Break)

* Do not return higher error code than 254
* Prevent returning negative error codes