Changed the implementation of inherits.
Added more test specs.