Fixed #1612: In rare circumstances an extra comma is added after import and before comment. marked in changelog