Minor changes to parameters. Fixed a few bugs as well.