 +        if (passes_walls(pm)) {
 +            fprintf(f, ", FlPhasing");
 +        }
-+#define AT(a, b) if (pm->mflags3 & a) fprintf(f, ", %s", b);
++#define AT(a, b) if (pm->mflags3 & a) { \
++    if ( comma_set ) fprintf(f, ", "); \
++    comma_set = 1;\
++    fprintf(f, "%s", b); \
++}
 +        AT(M3_WANTSAMUL, "FlWantsAmulet");
 +        AT(M3_WANTSBELL, "FlWantsBell");
 +        AT(M3_WANTSBOOK, "FlWantsBook");

+        else if (vegetarian(pm)) fprintf(f, ", FlVegetarian");
+
+#undef AT
+        fprintf(f, "]), ");
+        fprintf(f, "moColor = ");
+        switch(pm->mcolor)
+        {
+            case CLR_BLACK: fprintf(f, "Black"); break;

diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c
index a13514f..57c0b6f 100644
--- a/sys/unix/unixmain.c
+++ b/sys/unix/unixmain.c
@@ -44,11 +44,19 @@ static void NDECL(wd_message);
 static boolean wiz_error_flag = FALSE;
 #endif
