Fixed scripted test failures introduced by the "added toMap method" commit