few fixes for problems discovered on Linux