Synced from jreale4's updates.