Fixed associated entity problems and edit page

Change-Id: I53a8c575b74e65b3cba0883162d640903da78663