Fixed some sketchy bugs