Improved Amazon EC2 support
Fixed reading environment variables