Fixed some lint warnings

- util was declared
- i was undeclared
- fixed lint compare-warning
- old was is already defined
- added semicolon