Fixed a bug in the function to mark equations