Fixed a few problems