refs #2679: Tests and fix for the bug