fixed issues mentioned by danqing yesterday