fix tests for win64
code cleanup