fixed: crash on typedef of unnamed struct

typedef unnamed struct declarations were trying to free unallocated
memory. In fixing this it was discovered that the unnamed structs
were generating non-member functions with the unnamed struct as the
name. This bug is also fixed in this commit.