Fix minor bug in build() argument validation