private function tweak()
    {
        // Ignore recoverable GD errors
        ini_set('gd.jpeg_ignore_warning', 1);

        // Handle error reporting
        if (isset($this->config['production']) && false === $this->config['production']) {
            // Custom exception handler should be registered on NON-AJAX requests only
            $server = $this->input->getServer();

            if (!isset($server['HTTP_X_REQUESTED_WITH'])) {
                // Custom exception handler
                $excepetionHandler = new ExceptionHandler();
                $excepetionHandler->register();
            }

            error_reporting(self::ERR_LEVEL_MAX);
            ini_set('display_errors', 1);

        } else {
            error_reporting(self::ERR_LEVEL_NONE);
        }

        // In most cases, we require UTF-8 as a default charset
        if (!isset($this->config['charset'])) {
            ini_set('default_charset', self::DEFAULT_CHARSET);
            mb_internal_encoding(self::DEFAULT_CHARSET);

        } else {
            ini_set('default_charset', $this->config['charset']);
            mb_internal_encoding($this->config['charset']);
        }

        mb_substitute_character('none');

        // Locale
        if (isset($this->config['locale'])) {
            setlocale(LC_ALL, $this->config['locale']);
        }

        // Timezone
        if (isset($this->config['timezone'])) {
            date_default_timezone_set($this->config['timezone']);
        }

        // And lastly, magic quotes filter
        $mg = new MagicQuotesFilter();

        if ($mg->enabled()) {
            $mg->deactivate();

            $this->input->setQuery($mg->filter($this->input->getQuery()));
            $this->input->setPost($mg->filter($this->input->getPost()));
            $this->input->setCookie($mg->filter($this->input->getCookie()));

            // Third party libraries might use $_REQUEST as well, so we'd better filter this one too
            $this->input->setRequest($mg->filter($this->input->getRequest()));
        }
    }