Address exceptions in computation logic

Progress commit, still a few bugs left

Change-Id: I0cfedaac38fbc31c057583a1686195d4a9d7dbf7