Fixes some issues with variables