fixed macros for val functions.