Changed the move and apply functions to make them thread compatible.
--parry