Corrected bug in extract int