Fixed a bug, where ids were not properly set after loading