Added debug output and some try catches.
Updated todos