Added better error handling for "rebuild" and "push".