Fixed #278: getting localname as string explicitly everywhere