JC-1333 fixed. Additional tests created. Code review concerned
Merge pull request #9 from johnnybigfoot/master

JC-1333 fixed. Additional tests created. Code review concerned