added genPatches + misc fixes