Added some tracing
Bugfix: Peek at top of stack to determine action, don't pop it
Improved tracing a bit