improve debug output
add gerton's changes to fastfunc