Some fixes for extract, still some bug