Fix to prevent fatal errors by @batmoo