Added a better version of a popout than currently in the branch.
Fixes small bug for detecting presence (state attr vs element).