Fixed so the url-search stops at correct depth.
Refactored readProperties.