Fix #1043 - Fixed issue when creating a _new_ entity with a many-to-many relationship

It's a pretty simple fix. Comment inline.