Fixing no use before define issues