fix path compression & cleanup