several fixes