Fixed Bug in inverse