Fix for algo rerun and some cosmetic changes