Add further error checking.