Grammar fixes and character codes