Added null byte check