Fixes discovered through running on CentOS

Signed-off-by: David Scott <dave.scott@eu.citrix.com>