More stringent checking for datum types

in ScriptDatum metaprogramming magic functions.