Fix for crash when switching dark theme under X
