Fixed bug with handling functions in select