Calculator: UI detects invalid operations