Compatibility fixes for Mono. Includes and closes #80.