Apache master merge

Merged apache master and handle merge conflicts.