More bulletproof code