Fixed bug related to class inheritance