changes to correct #C6 and #C7 bugs