Fixed popup logic and apearance.