Fixed major bug in indentation and added more logging.