Fix a few bugs.  dynamic_cast and gaussian eval