added unittests via make check
minor modifications