Fixes a lot of warnings - reference to temp