last part of fixes for the previous merge