Added checks on wrong insertions on darray