Fixed some last minute bugs