Add better extension checking.