Fixed tests for method defs and reference counting

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>