Fixed the counting error on in-between objects count

Signed-off-by: Thomas Seng Hin Mak <makzan@gmail.com>