Pulling in latest changes from Mathias's files