Various Optimizations/Fixes