bug fixes and library lookup stuff;