Fix bug with variable declaration