Tests for Redmine #84, and fix to allocation_rule model.
Merge branch 'master' into ted
Merge branch 'master' into ted