erg factor: fixing [[ ]] and some unit tests
Latest commit 0a77f6c Aug 2, 2018