hugepages: fixes from Mrten in issue #308