Random Fixes

Random fixes throughout different parts of the code