Added more tests

* Simplified the ERB file
* Errors are handled (slightly) better