Improved architecture handling and bug fixes.
Merge branch 'master' into 2.0