Fixed issue with duplicate flights and added test

Fixed the issue with duplicate flights and added a test flight that is
sure to fail in the cancelFlight process.