Minor improvements.
Fixed #2 by making the amplitude determination more accurate and
restricting it to the extract being processed.