add includes, remove V1 & V2, fix gcc warnings