Last few bug fixes