Catching OSError during execution. Closes #22