Fixes Issue 5924

http://d.puremagic.com/issues/show_bug.cgi?id=5924

Attempts to fix previously introduced bug. Oddly, local unittests were passing.