various small fixes - still needs a lot of work