Make more compatible with mono. Finish scripting improvements.