Minor error checking