lots of fixes following feedback by betehess