Fixed replication bug in BlockManager
Merge pull request #501 from tdas/master

Fixed bug in BlockManager and added a testcase