Fix more bugs and more syntax errors