Debug Log and minor fix