Fix a NPE in synth and some other small things.