Treat return-type warning as an error.
Fix related UB bugs.