Ported a few changes to Linux