NPE fixes for definition