Little bit of defence when logging

+ few bugs deleted