Prevent crashing on DELETE (from accessing invalid property)

Also small changes to popups. Nothing deserving its own commit, AFAICT.