Fixed `variables` function to remove duplicates. `nnf` now works ok.