Changed run-time checks to debug assertions

-Changed some run-time checks to debug assertions. Some things must
deterministically work every time such command is executed.
-Modified some pointer checks for clarity.