Fix Exception::getPrevious return type to be nullable

Closes #413