Fix bug in bash/functions