Fixes from b2ae7a2