Replaced typeof with __typeof__ because of compatibility issues