Fix bug with uninitialized variables