Fix regression problems with weird-files tests

Fixes #362: regression tests using the "weird files" are failing on
solaris and Ubuntu 12.4 and 14.4