Fix bug with rest filtering