Fixed an NPE reported by Jukka.