Minor program flow changes and some header size adjustments