Fix -Wreturn-type warning
Fix -Wunused-variable warnings