Fix useRealisticMass issue.

Also wrapped callbacks in try/catch for better error tracking.