`ret_code` is assigned here and below, but never used. The variable should probably just be removed.