Fixing a bunch of issues