Merge pull request #406 from bhariharan/unstable

Latest shared commit
Fix for potential NPE while restoring Activity