Bug fixes in inheritance