Improved positioning logic for entities to avoid unusual arrow head positions and upper-right placements.