Casting with a lua error

Josh-

This code currently gives a lua error which I am trying to fix (any insight if you have time to run the code would be awesome!) I wanted to give you an idea of where I think we are going with casting and see if you agree or disagree before I go any further. Do you like the to"Hash" setup for casting or would you prefer a different approach? Also is the getDstHash() function a suitable solution for allocation in the case of casting?