ENH: fixing bugs