Fixed bug where a class that extended a parent class and had its own
constructor would cause a PHP error and tidied up code