Bug fixing after further testing on Linux