Added test for Redmine issue #2604.
Implemented fix for Redmine issue #2604.

Also, added validation to yield model to require non-negative yields.