Corrected SDL initialization to handle events