Fixed error logging bug (message formatting).
Improved diagnostics for build errors