Changing initialization sequence to ensure proper thread affinities
Adding another regression test for #588