Fixed bug regarding empty lines after math blocks.

What was happening was an empty line at the end of a math block was
being treated as a successful equation and an extra \\ linebreak
was added.  This fix adds two tests for the behavior and fixes
the bug by filtering on only lines that have contents.