Do more error checking. Refs. #367