Did a whole lot of work on error checking.