Bugfix, t1_v1
Repairs and substantial refactoring.