Just noticed the code for reducing vertical speed when releasing jump was accidentally duplicated. So you lose basically all momentum from a jump the instant you release the button - would explain why double jumping is so difficult!