Add missing error checks