fix bug where last snapshot wasn't being recorded in db

 and fix time incrementing - it was subtly wrong