Refactor and fix erroring
Add traceback printing on error

Close #150