Tweaks

Fixed incorrect setupRHS3d function which was not properly accounting
for cells on the boundary

Using fmax in a couple of places where std::max was used