Fix issue #2258

I write simple test that shows the problem. I fix it but i am not sure about this fix. What do you think?