Add explicit tests for used functions and constants with scalar expressions