Fixing inverse bug