Extract source fix

I reproduced the bug case mentioned in #11 and added to the integration test

then patch it

closes #11