Fixed invalid class references and call to undefined method