Fixed lots of problems