Updated from avalon branch #1fc1ea1121