FIX various errors in persistence detection