Fix: Provided parent element not set correctly

Fixes bug with parent element not being correctly set if provided in
options field.
Merge pull request #311 from vitorhsb/master

Fix: Provided parent element not set correctly