Fixed error checking and simplified - all or nothing.