Fixed infinite reloading

Fixes issue #104.