Standardise error-checking.