add more fixes to libary-dir patch