Fixing small bugs with extract script