Added missing imports
Fixed variable reference