[PATCH] Fix check_partition routines