Fixed #1: Regression in extend()

Switching to type() instead of klass() wasn't such a good idea