Cleaned up comments, fixed a small bug if error occurred.
Merge branch 'Thomas'
bugz