minor fixes + new tests