Fixed code for mathematics that is in a mathfork