Some fixing and console.logging