Many fixes to astro functions