Fixed $CONF['debug'] set where used. Can now be changed from config.php as would be expected.