Fixing extraction routines