Merge fixes from Tectas source