Updated for upstream changes