fix and clean up permalinks