fixes to improve compatibility with multistaging