Fixed indent, error checking