Workaround for NRE on linux

Fixes #2416