Fix for issue #19
improved a bit saving references in embeddeds