Fix for mono

Works (at least) under mono 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.1) now. Needs further testing.