MGM: adding OpenAtrium patches, minor cleanup.