Handle attributes parsing more consistently