Additional grammar and code cleanup