Various Fixes; Cleaner Code