Fix some issues which were missed when creating separated code