NPE fixes, orientation change handling