Add logging and fix too long database names #11