Test cases from #364 added.

--HG--
extra : source : 489069f747659723e75779cd2e6fb91f104e1bff
Merge pull request #462 from iskiselev/Issue364_Tests

Test cases from #364 added.