fix warnings, returning local variables #57