Fix mouse scrolling and remove unreachable code