fix sqlite fail
ref lastseen
mv errors to own file
clean up reply_dispatch mess
formatting fix