Try to catch environment errors. Closes Issue #9