Improved theme handling
Added better debugging options