Validate package name when doing search

+ tests

fix #122