[MSHARED-325] Failing testcases. Submitted by Mikolaj Izdebski, applied unchanged.
[MSHARED-325] Fixed bug, fix by me.