more syntax fixes and logging