So some error-checking when using the 10.7 code path.
Merge branch 'patterns'
Merge branch 'master' into imageRep