Removed debug code.
v2.6
Fixed permalink loop when parent permalinks enabled.