Fix NPE in EntrancePI

This fixes issue #45. However there still are some problems with S4. See #48