Fixes #421

Tested this manually in bash and zsh