Merged fixes from master.