Bug fixes

Only logging errors, but still one invalid write (and also possible an invalid read) fixed if the corresponding logging features are enabled.