Minor Fixes

Some minor fixes (untested):

* Set error status when an internal error happens.
* Use `expand-file-name` instead of `concat`
* Replace `insert-string` with `insert`