Fixed bug where build() returned undefined.