command/build: fixes #399, fixes #398, fixes #397