fixed rspec test so that it breaks BSON serialization
fixed tests on code with scope to reveal bug
added changes to fix bug in code with scope