Fixed some small bugs, still not working 100%