Fixed bug in GEN fit