Sync fixes from master