Fix null elements and add requirement checks