Changes to make compatible with MONO