Slew of bug fixes, cleaning up console.log