Merge "Fix math errors causing black screen. DO NOT MERGE" into jb-mr1.1-dev