fixed math mode problems