Add rudimentary error handling.