Fixes NPE on close. Closes #77 @10m