Error handler protection

#389