More fixes from @alexbennett