Working error checking.