Handle missing elements more gracefully