Added support for restricting widgets on subclasses (fixes #5)