Fixed up/down arrow bug