Fixed bug in virtual columns with 'set_function'

See in-code comments