Fix some bugs of sugrcube.

Change-Id: I2cf6e5beb3f7312f903559fd07d6204662a3e398