Fix up empty build detection logic