Fixes minor bugs and log