Fix specs: Check that 'val' function is defined instead of calling it.