Fix metas sync when creating connections programmatically and more

Sorry for the fuss of the 647808a96c3713b5428c8d0b611fef5feca07767 commit. It seems that your code needed to be prettified according to my IDE (PhpStorm)