ENH: few bugs corrected