Improved the print_stack() function

http://wiki.bash-hackers.org/commands/builtin/caller?s[]=logging#simple_stack_trace