Fix for assertion crash in YapDatabaseView. Bug caused by recent commit. Unit test added.