Global function isScalar has been refactored