Fixes #3608.
Created by: ComicIronic
Flatpacks now use more of the regular construction code, so this won't happen again. This revealed a few bugs in construction to do with passing steps around, so that should work fine. Added a couple of sanity checks here and there.