Implemented return for user-defined functions, fixes #2