Bugfixes on history directive.