Fixed some issues in AmazonS3 connector