Cleaned up the debug and led functionality.