Fixed a few bugs with stages