Fix bug in sketch