More rigorous testing of invalid arguments to build()