fixed equation display bugs

Change-Id: Ib0b7bdbd28e5e4cd1b20bbc58f86a306c8c60c3f