Fix using notices and not-defined variables