Merge from pi-engine