minor fixes + test code