Removed the debugging code
code review minor changes
Removed certain preconditions and fixed a bug
merged 0.9.5 to MLHR-970