fixing bugs reported by MLNPP