Fix terminal bug