Fix mount ordering to be more robust
Some code cleanup