[CLEANUP] Ensure all variables are set before usage