Add extra errors and error-checking.