fix code and tests

re nvie/pip-tools/pull#72