diff --git a/changes-5.1.html b/changes-5.1.html
index a91faff76..93fe73db7 100644
--- a/changes-5.1.html
+++ b/changes-5.1.html
@@ -16,6 +16,8 @@
Yap-5.1.2:
+- FIXED: current_thread/2 should fail if called with bad alias or
+ID (obs Paulo Moura).
- FIXED: correct code statistics with DL_MALLOC or SYSTEM_MALLOC.
- NEW: use true_file_name for file operations in system library (obs Paulo Moura).
- NEW: make YAP large address aware on WIN32 (should be able to
diff --git a/pl/threads.yap b/pl/threads.yap
index 9d3699b30..76a107f21 100644
--- a/pl/threads.yap
+++ b/pl/threads.yap
@@ -163,8 +163,8 @@ current_thread(Tid, Status) :-
var(Tid), !,
'$cur_threads'(0, Tid, Status).
current_thread(Tid, Status) :-
+ ( atom(Tid) ; integer(Tid) ), !,
'$check_thread_alias'(Id0,Tid),
- integer(Id0), !,
'$valid_thread'(Id0),
'$thr_status'(Id0, Status).
current_thread(Tid, Status) :-