Code cleanup
Code cleanup and better error reporting, all LOG functions were removed from real-time context