Nakagami admits to close shaves in qualifying