Fix some issues related to AlaisValue reconstruction