Fix code warnings

- use of 'persist' is deprecated
- variable 'u' is defined but not used