several fixes after review