Fixed some null-bug with the new code style.