faster Int/Word -> Integer conversion, arithmetic and threading fixes