vmem: implementation of vmem_check()

Some small changes after review. Output error text.