Fixed interactive JavaScript bug

Fixes #2