Fixed error checking