Better solution to #200, reverted solution #201 and fixed #202 and #200 at once. Fixes #202 refs #200 refs #201
small fix to work with sub-subdomains