Added extend declaration inside a body.
Added warning on nested extend.
issue #151