Fixes from my patch