Fixes minor things in a few files to help speed up the code.