fixed bug in load/reload...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
refactoring and several bugfixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>