Fix warnings when building without logging and assertions

Note: "UNUSED(refcnt);" has been added at merge time on line 1287 of
core.c in addition to other changes contained within the PR.

Closes #1508
4 files changed