Some fixes from Tonic