Fix #592
Integrate abc into library with some critical fixes