Fixed user and cohort post counting problem and added tests