Dev bug fix

Adding some checks to ensure that a NRE doesn't get thrown to the user, and to make it harder to encounter.