Stronger error handling in Builder

Makes no assumptions that a function is called with string or and
integer.