More performance tweaks, fix global stdlog