Tried to fix some bugs, still major ones around