Bug in buffer manager fixed

Signed-off-by: Sergey Krivohatskiy <s.krivohatskiy@gmail.com>