Updates to get latex mode working right