Fix bug where an empty field would cause an error to be thrown