more verbose malloc check; code beauty