Updated from avalon branch #8986c99f55