Uitests: Fix some bug in tests

Review: http://mrccodereview.cloudapp.net/ui#review:id=1240