Fixed entity count issue.
Wrong return value for getManager() fixed.