lots of fixes - see issues tracker