Fix the bug when refining with entity without ports.

Last commit was wrong. A bad fil was commited by error