Fix typo with calculate_value exception handling