Correcting type alignment and error condition handling.