Fixed wrong variable names causing notices