Fixing issue #1104 and updating tests.

You are right about the test.
I'll update my PR ASAP.