Fixed many partition bugs.