ENH Fix bugs