Centralize scalar checking
Improve test coverage