Stack and log fixes