fix trailing slash logic for --prefix