Fixed lots of issues