Access denied error in tests

Some fixes in test so they would pass on windows. Tested on Windows 7 (py26, py27).