Fixed some bugs on filter and rank methods