Merged (manually) from v1.3.x branch