fixed gamma parametrization and some minor issues