Fixed some bugs, added more header stuff