Fixed a bug.

Will be adding more changes later.