Fixes #3747 - Fix initialization of variables