fixes issues 6195 and 6690