Fixed a few latent bugs and changed some default parameter values.