added AffairGenerator and test + minor bug fixes