Fixing bugs. Fixed a typo.