Properly reinitialize variables when reloading
Fixes #28