Attached are some quickly-whipped-up patches to allow proper Berkeley db searching and allow for library names with dashes and periods where related directories have no punctuation. These could probably be cleaned up a little.