WIP: handle output dim calculation immidiatly
WIP/BUG: Add missing index DECREF.
WIP: Smaller fixes/moves