Fix typo & malloc result check