Fix merging of nested elements.
Fix dialogs for Harmattan version.
Add hacks for Sailfish dialogs.