Fix id stuff and better database