Updated test code for different OS