Bundles: Fix bundle files containing ".bundle"

Handle nested extensions properly.

Fixes #386