Merged upstream changes and updated documentation