correcting some wrong dispatches and return types in complex if_else