Fixed some smaller bugs