Adding some notes on the docs for scalar() and adding a testcase for the
docs example