Preventing hoisting and scope errors