Fix asReal and asNatural to return correct value