Fixed several smaller bugs after first test