MPG: Minor fixes to run on FreeBSD