fixed annoying latex bugs