Lots of input checking.