Implement several control sequences
Fix two small bugs