Improved getValue() and getResult() for coherent return types. Programs should work fine. TODO: DEBUG