Variety of efficiency and logging edits + minor bugfixes