Made error checking more consistent