Final POPL2014 version