Fix for returning a scalar EJSON type from a method #731

Tests for returning a scalar EJSON type from a method