fixing df bug (thanks Yihui)