Better error catching.