fixed some small issues revealed by the inst/tests