fix compile warning:
suggest explicit braces to avoid ambiguous ‘else’
remove unused option/ifdefs
fix order of init