diff --git a/basis/tools/profiler/profiler-tests.factor b/basis/tools/profiler/profiler-tests.factor
index 75ca5ede8c..f0c71aa311 100644
--- a/basis/tools/profiler/profiler-tests.factor
+++ b/basis/tools/profiler/profiler-tests.factor
@@ -1,6 +1,7 @@
 IN: tools.profiler.tests
 USING: accessors tools.profiler tools.test kernel memory math
-threads alien tools.profiler.private sequences compiler.units ;
+threads alien tools.profiler.private sequences compiler.units
+words ;
 
 [ t ] [
     \ length counter>>
@@ -54,3 +55,7 @@ threads alien tools.profiler.private sequences compiler.units ;
 ] unit-test
 
 [ 666 ] [ \ recompile-while-profiling-test counter>> ] unit-test
+
+[ ] [ [ [ ] compile-call ] profile ] unit-test
+
+[ [ gensym execute ] profile ] [ T{ undefined } = ] must-fail-with
diff --git a/vm/profiler.c b/vm/profiler.c
index 27e903178b..250e5a996a 100755
--- a/vm/profiler.c
+++ b/vm/profiler.c
@@ -32,7 +32,6 @@ F_COMPILED *compile_profiling_stub(F_WORD *word)
 /* Allocates memory */
 void update_word_xt(F_WORD *word)
 {
-	/* If we just enabled the profiler, reset call count */
 	if(profiling_p)
 	{
 		if(!word->profiling)
diff --git a/vm/types.c b/vm/types.c
index 5e2ed4bed9..38fe3460e7 100755
--- a/vm/types.c
+++ b/vm/types.c
@@ -61,6 +61,9 @@ F_WORD *allot_word(CELL vocab, CELL name)
 	update_word_xt(word);
 	UNREGISTER_UNTAGGED(word);
 
+	if(profiling_p)
+		iterate_code_heap_step(word->profiling,relocate_code_block);
+
 	return word;
 }
 
@@ -76,7 +79,7 @@ DEFINE_PRIMITIVE(word)
 DEFINE_PRIMITIVE(word_xt)
 {
 	F_WORD *word = untag_word(dpop());
-	F_COMPILED *code = word->code;
+	F_COMPILED *code = (profiling_p ? word->profiling : word->code);
 	dpush(allot_cell((CELL)code + sizeof(F_COMPILED)));
 	dpush(allot_cell((CELL)code + sizeof(F_COMPILED) + code->code_length));
 }