Fixing issue #1104 and updating tests.

I thought there is no need for another one because this updated one also satisfies its previous purpose. but anyway, you are the man in charge ... :)