Fixes seg fault on some systems