Updated for recent code changes