Fix crash on startup on Linux

Fix originally provided by gliptic.