fixed bug when handling Sub nodes
changes to debug output of optimize Phi
generated documentation