Fixes minor code issues.

- a forgotten variable definition
- duplicate flag entry