Fix keytype on filtered tables