minor changes to lib
cleaning up merge conflict.