Tighten up the retrieval of properties. 

This uses less temp objects and is more straightforward. Also, sorting 
happens when properties are added.
Fix bug introduced by lack of sorting.