fix and warn about wrong return types