Correct partition detection logic and checks