Add some basic error handling: Fix #1.