Added correct ZSH error handling code.

This is quite important and can solve weird little glitches in the shell.
Merge pull request #1 from radiosilence/patch-1

Added correct ZSH error handling code.