Merged in changes from 0.3 to 0.5 of original yari