Fix condition in allocate.
Merge remote-tracking branch 'upstream/master'
Merge pull request #235 from fmap/master

Fix bug in allocate.