Fix attribute handling for non-regular files