Simulation of atmospheric muon and neutrino fluxes with CORSIKA