Fix for Mono 2.x not returning the correct exception