lots of fixes - see post for changelog