Add error-checking.