Nil pointer deference fix

Also fixed some bad formatting directives.

:dancers: