Fixed the crashing bug https://github.com/couchbaselabs/TouchDB-iOS/issues/266