Fix bug in inverse_ALK.r