Updated with 8ba092f188 from avalon branch