Adding package retrieve and fixed small issues