Fixed bugs about "Object reference not set to an instance of an object" in some views.