Cast possibly ambiguous invocations of 'count'. Fixes #113