Fix page type detection