Fix #5.

This fix alter performance a lot. So this is not the end of the story.