patch #538: partial merge: fix validate function, fix double parent risk, fix display of wrong projects in hierarchy
patch #534: remove unset var
Fixed PHP syntax error
Merged from 5.2