Added a stack trace
Minor bug fixes.