Fixed bug in calculate_add_flags routine wrt the Z flag.