Popup refactor. isPopup method
Input Error fixes
Tests update