Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values