Fixed bug in previous version
Merge branch 'makopov' into test