Added permission, changed test filter code a bit.