fixed inheritance behaviour and tests