Fix partition discovery bug