Fix library handling