Added first part of Marc's Linux patch