Mostly correct decode

had bad short declarations all over