Fixes to popup and error