Fixed a few more bugs