small code fixes