Bugfix: enforce history size > 0