Fixed partitioning bug in minimize