TsLint: More cleanner error handling

* More cleanner error handling.
* Fixes issues #455 and #456.