GUI: fix possible NPEs