fixes recommended by Matias