Fix bug in library name checking