Fixed inheritance to avoid problems with "this" context