A few little cleanups/optimizations