Bugfixes when creating a new endpoint