Fix for older versions of Mono, fixes issue #1136.