Fix possible null pointer issue in Momentum class