fix compile
fix some compile warnings:

- comparison with string literal results in unspecified behaviour
- unused function
- suggest explicit braces to avoid ambiguous ‘else’
- unused vars