Fixed most of the stuff i broke during the refactor