See test case.
Created attachment 46398 [details] Test case
I have a patch for this. Just running the tests right now.
Created attachment 46401 [details] Patch
Thanks Sam! Fixed with r53166.