Fixed bugs setting id_map release flags, memory freeing when freeing device, pointer bug.