Tidy up things. Fixed null issue on inbox.