Fixed restart issues #48 as described by @digitalsadhu