Merge "Fix math errors causing black screen."