Clean up error handling in keymat_v2_t