Added some validateion code to Stage.