Enhance the logging, fix a bit of JS