Fixing issue #1104 and updating tests.

It's a pleasure for us to have contributions in li3.
PS: @koushki and I are friends/colleagues. We are competing to contribute to li3.
And I couldn't find any easier issue to solve ;)