Last database insert fixes and logger updates