Subtracts two numbers, handling undefined values