set of fixes

set of important and minor fixes