Random fixes

Some somewhat related fixes I made while working on lit.