Fix library setting code