Checked scope of variables to make sure there was no conflict when run in parallel. Biggest change was to fluid where the RHS made reference to tmp variable which was defined globally and locally previously.