Improved handling of private names in opt_clean and rename commands
Fixed topological ordering in freduce pass