Add more unit tests and fix problems
Merge pull request #25 from fluxroot/JCPI-11

Add more unit tests and fix problems

JCPI-11 #resolve