ErrorHandling and logging of DB interaction

ErrorHandling and logging of DB interaction is slightly improved. The
log will show actual interactions with the data, because of this I
noticed a few errors with royalties.