Minor error-checking