Made a few more small optimizations