Fix illegal monitor state
Fix type parameter for IOStage
Fix failed tests