Code cleanup based on Insight analyze.

1) Typehinted known objects.
2) Strict comparison (with === operator)