Math: now works properly with the pager. Fixes #621