Gracefully handle NaNs in Hamiltonian

Addresses Issue #121.  The static HMC code was missing a NaN check.