some more patches and changes