Build system: small fixes

as reported by @samoht