Misc tools, fixes