Refinements and bugfixes