Fix possible NRE
Fix minor code styles