Return isn't needed after error()
Change from a chat output to error()
Add error checks for the result of the dofile, so that we don't error out
trying to add them to the user environment.
Merge pull request #632 from Kinematics/4.1-dev

4.1 dev