Now also supporting ec2 ps format (huge help from Claudiu).