more bug fixes - intermediate