Added some tests to check the sanity of generated cycles stored in db.