Fixed foundation/functions bug