Error tracking

-Bug fixes.
-Added some code to track an specific error.