Some tweaks and additional logging