Fix some warnings which are causing debug builds to fail.

- Clang: private field 'module' is not used
- GCC: suggest a space before ‘;’ or explicit braces around empty body in ‘while’ statement