Minor bug fixes to language system

Signed-off-by: Peter Chester <peter@tri.be>