Fixed random bugs