Prevent some undefined method on nil errors

Can happen on empty lines and such.