Fixed issues with variables