Manager entity id bug fixed, test system fixed, tests added