Errors vs asserts and other style issues

* Replace asserts with Errors
* Style issues