Temporary fix of issue #4

Properly initialize memory before using. But the routine may need a
complete rewrite in future.