Fix common path calculation