Build event fix, minor code clean up.