Updated code to as of TPAMI submission.