Fixes #361, ensure build errors are propagated through to optimize errback

Thanks for the help putting the test case in the right place.