Fix filtered tags hash
Clean-up code