Added rudimentary error handling (closes #9 for now).