Fix for issue #19

Fix for issue #19: An embedded document cannot refer to other documents