Prevent errors in iframe gadgets with dist dir

Fixes #147