Fixed strlen() check