Added some checking for whether certain constants are defined.