Database now function properly (at least with the small amount of entries so far).