Prevent NPE
Add test