Fixed issue with 'count' block code generation