Minor fixes in the code
Fixed regex for inline math