Merge from mono-soc-2012

Merge latest changes from forked branch.