A not so great hack to check types at runtime.