Fix wrong ranges