Add tests for coverage the bug.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>