Bug fixes for research phase