Replace exit for return

Exiting from a sourced script causes the shell to exit. Returning will result in the desired behaviour.