Correctly handle drawing groups within an embedded shape

Fixes #886 and #887
Merge pull request #918 from tschneidereit/master

Correctly handle drawing groups within an embedded shape