Stdlib fixes

Couple of outstanding issues in stdlib fixed. "--" commit can be removed if JavaScript backend is fixed to handle the case or merged into singleOrNull commit if fix is postponed. All tests are green.