Fix inheritance examples
Tidy code a little

* Remove unneeded var
* Remove type conversion in selection statement (== to ===)