Made addStage more specific about invalid stages
Minor code cleaning