Remove empty protocols when recompiling a method, fixing issue #691