Fix bugs (uint_8 is too small, getFinalY was inverted)