Fixed some major problems