Better script debug, other minor fixes on net