Fixes from porting to AWS