Do some null checks correctly.
Some small tweaks towards getting backend working.