Various fixes.

Fixed an unhandled exception in viewing history and fixed paths in the
layout when running from a subdirectory.