implemented code review findings by janos

See more info in http://codereview.stackexchange.com/questions/58485/function-autoloading-in-bash