Added --batch function fixed up some missnameing in errors, and changed $pwd to pass to avoid stomping on bash native pwd