Fix bugs with in-place implementation of safe_log
Work around requirement for lmda vs expLmda in A update
Bugs: Failed to correclty handle safe_log(x,out) case where x and out referenced the same memoryvew
Incorrectly took the exp when returning the query state