Comment 33 for bug 1251590

All - here's the patch with tests for master - please review and make sure the test is valid as well.