Fix generation of incorrect code when .erlang-name property is set in functions