Fixed some bugs in ValueHolderBase and added a test for it.