Fixed a couple bugs