Fixes for compiler warnings

Here are some fixes for compiler warnings that can be produced by generated code.

One is about unused variable and the other is about returning different/incompatible type.