Fixed bug in extract method.