Fixed a few things with the popup window

(the other 2 previous commits are just me merging your branch back in)