fixed bug with reverse on non-empty paths with empty names