Patch Set 1: Looks good to me, approved

The dependent change 1888 fixes additional stuff and finally brings a tests. This testcase proofs that we need this fix. Without Lluis fix that testcase will fail. Shawn, are you convinced? (I know it would be more convenient to have a seperate test for just this fix - but that would be to much work for no good reason since I touch again the lines added here and test the whole thing in 1888)