Fix integer division compatibility in middleware

Changed '/' syntax for code which requires integer result to
Python3 compatible '//'.

Change-Id: Idd61c134a8083e7d5e8f1db19372a76380bcddc0
Merge "Fix integer division compatibility in middleware"