Fixed logging to console