Fixed code style
Fixed a bug with unicode and shelve