bugs fixes reported by Michael