Minor bug fixes including console.log usage