Update manage.sh script
Fixes and improvements