Bug fixes for Linux