Fixed initialization of element IDs