Clean up syntax and fix TTS null check