restored Linux support, fixed some specific issues