Deal with errors in a better way (fix #128)