fixes for several issues