Fixed public packages filtering, added version requirements, fixed dir name guessing.