Fixed #323

To be tested on slower machines