fix a few bugs for studio
merge bug fixes