Documents module: bug and UI fixes.