Fix bugs in create and update pin views.