Fix a bug in partition.
Merge pull request #3 from dcjones/master

Fix a bug in partition.