Fixed terminal cursor problems