Fixed PageTypeDeterminer to handle null edge cases