Filesize checking, code cleanup, fixed stage loading bug